const storyTypeCtrl = require('../controller/storytype');
let datas = null;
storyTypeCtrl.getBookTypeList(data => {
	datas = JSON.parse(JSON.stringify(data));
});
module.exports = function(swig){
	swig.setFilter('status', function(d) {
		switch(d) {
			case 0:
				return "已完结";
			break;
			case 1:
				return "更新中"
			break;
		}
		return
	});
	swig.setFilter('bktype', function(d){
		let types = datas.find(x => x.id == d);
		return types.typename;
	});
	swig.setFilter('jsonformat', function(d){
		return JSON.stringify(d);
	});
}
